package org.easystub;

public class CaptureReporter {

    private final InvocationReporter reporter;
    private final CaptureStore captureStore;

    public CaptureReporter(InvocationReporter reporter, CaptureStore captureStore) {
        this.reporter = reporter;
        this.captureStore = captureStore;
    }

    /**
     * Registers a {@link org.easystub.Capture} instance for use when the method is called.
     */
    public void useCapture(Capture callback) {
        captureStore.registerCallbackForInvocation(reporter.lastInvocation(), callback);
    }
}
